<?php


namespace come;


class Template
{
    protected static $instance = null;

    /**
     * 模板配置参数
     * @var array
     */
    protected $config = [
        'tpl_begin'          => '{', // 模板引擎普通标签开始标记
        'tpl_end'            => '}', // 模板引擎普通标签结束标记
    ];

    function __construct(){
        $this->config['tpl_begin'] = preg_quote($this->config['tpl_begin'],'/');
        $this->config['tpl_end']   = preg_quote($this->config['tpl_end'],'/');
    }

    static public function parse(string &$content){
        // 内容为空不解析
        if (empty($content)) {
            return;
        }

        if(self::$instance===null){
            self::$instance = new self();
        }
        $template = self::$instance;

        //解析替换，持续...
    }
}